package com.alameda.config.spring;

import com.alameda.commonpent.context.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;

/**
 * spring装配组件配置类
 *
 * @author Lv
 * @date 2024/5/1
 */
@Configuration
public class SpringConfig implements ApplicationContextAware {
    /**
     * 设定装配启动容器
     *
     * @param applicationContext springboot运行容器
     */
    @Override
    @Autowired
    public void setApplicationContext(ApplicationContext applicationContext) {
        SpringContextHolder.setApplicationContext(applicationContext);
    }
}